package com.example.lp.lpuicore;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.example.lp.lpuicore.anim.AnimActivity;
import com.example.lp.lpuicore.canvas.CanvasActivity;
import com.example.lp.lpuicore.paint.PaintActivity;
import com.example.lp.lpuicore.test.TestViewActivity;
import com.example.lp.lpuicore.views.ViewActivity;

public class UiCoreActivity extends AppCompatActivity implements View.OnClickListener {
    private Button bt_paint,bt_canvas,bt_views,bt_anim,bt_test_view;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ui_core);
        intView();
    }

    private void intView() {
        bt_paint=findViewById(R.id.bt_paint);
        bt_canvas=findViewById(R.id.bt_canvas);
        bt_views=findViewById(R.id.bt_views);
        bt_views=findViewById(R.id.bt_views);
        bt_anim=findViewById(R.id.bt_anim);
        bt_test_view=findViewById(R.id.bt_test_view);
        bt_paint.setOnClickListener(this);
        bt_canvas.setOnClickListener(this);
        bt_views.setOnClickListener(this);
        bt_anim.setOnClickListener(this);
        bt_test_view.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        int i = v.getId();
        if (i == R.id.bt_paint) {
            Intent paintUi = new Intent(this, PaintActivity.class);
            startActivity(paintUi);
        }else if(i==R.id.bt_canvas){
            Intent canvasUi = new Intent(this, CanvasActivity.class);
            startActivity(canvasUi);
        }else if(i==R.id.bt_views){
            Intent viewUi = new Intent(this, ViewActivity.class);
            startActivity(viewUi);
        }
        else if(i==R.id.bt_anim){
            Intent anim = new Intent(this, AnimActivity.class);
            startActivity(anim);
        }
        else if(i==R.id.bt_test_view){
            Intent anim = new Intent(this, TestViewActivity.class);
            startActivity(anim);
        }

    }
}
